<?php

	$id = $_GET['id'];
	
	$filename = selectOne('product',"id=".$id);
	$str = $filename['file'];
	if(file_exists($str))
	{
		unlink($str);	
	}
	$re = delete('product',$id);
	if($re)
	{
		echo '删除成功';
		header('Refresh:1;index.php?a=admin&b=product&c=index');
		die;
	}
	else
	{
		echo '删除失败';
		header('Refresh:1;index.php?a=admin&b=product&c=index');
		die;
	}


?>